import { Button, Col, Input, Row } from 'antd'
import React from 'react'
import { AigcListType } from '@/types'
export default function AigcList({ list }: { list: AigcListType[] }) {
  const ResultList: any[] = []
  list.forEach((item) => {
    ResultList.push(
      <Row gutter={4} key={item.title} className="aigc-row">
        <Col span={2}>{item.title}</Col>
        <Col span={5}>
          {item.input ? <Input value={item.data} disabled /> : <>{item.data}</>}
        </Col>
        <Col span={1} className="flex justify-end">
          <Button
            type="primary"
            onClick={() => {
              item.btnOnClick(item)
            }}
          >
            {item.buttonText}
          </Button>
        </Col>
      </Row>
    )
  })
  // console.log(ResultList);
  return <>{ResultList}</>
}
